package tunafish2k.rpgex.registries;

import com.mojang.serialization.Codec;

import net.minecraft.component.ComponentType;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import tunafish2k.rpgex.RpgEX;

public class ComponentRegistry {
    public static ComponentType<Integer> SINGLE_TYPE_AMMO = ComponentType.<Integer>builder().codec(Codec.INT).build();

    public static <T> ComponentType<T> register(String id, ComponentType<T> componentType) {
        return Registry.register(Registries.DATA_COMPONENT_TYPE, Identifier.of(RpgEX.MOD_ID, id), componentType);
    }

    public static void registerAll() {
        register("single_type_ammo", SINGLE_TYPE_AMMO);
    }
}
